<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?php 
	$AGENT = getAccountUserObject();
	
	$current_dbprefix = $this->db->dbprefix;
	$this->db->set_dbprefix('default_');
/*	
	$page = isset($_GET['per_page']) ? intval($_GET['per_page']) : 0 ;
	$records_per_page = 400; 
	$total = $this->db->where('user_id',$AGENT->getId())->
			count_all_results(TBL_ESCORT);
			
	$pagination = create_pagination( 
								$uri = 'agent/async/load_escort_page?', 
								$total_rows = $total , 
								$limit= $records_per_page,
								$uri_segment = 0,
								TRUE, TRUE 
							);	*/
/*	$records = $this->db->where('user_id',$AGENT->getId()) 
			->limit($records_per_page, $page )->order_by('id','desc')->get(TBL_ESCORT)->result();*/

	$records = $this->db->where('user_id',$AGENT->getId()) 
			->order_by('id','desc')->get(TBL_ESCORT)->result();
					
	$this->db->set_dbprefix($current_dbprefix);		
	 
?>

<!-- 
<div id="escort-section-of-agent"> -->
<ul>
	<?php $i=0; foreach($records as $item):?>
		<?php $ESCORT = $this->escort_entity->init('id',$item->id);?>
			<li>
				<div class="escort-item" id="escort_li_<?php echo $ESCORT->getId();?>">
					<?php echo thumb($this->media_entity->getUserAvatarPicture($item->id), 100, 100);?>
					<div class="escort-name-x"><?php echo $ESCORT->getEscortName();?></div>
					<div class="escort-manage">
						<a href="<?php echo site_url("agent/preview/?escort_id=".$ESCORT->getId());?>">
							<?php echo language_translate('load_escorts_view');?>
						</a>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="<?php echo site_url("agent/profile/?escort_id=".$ESCORT->getId());//."&per_page=".$page ?>">
							<?php echo language_translate('load_escorts_edit');?>
						</a>
					</div>
					<div class="escort-delete-icon" rel="<?php echo $ESCORT->getId();?>" title="<?php echo language_translate('agent_dashboard_info_delete');?>"></div>
				</div>
			</li>
			<?php $i++;?>
	<?php endforeach;?>	
</ul>	
<script type="text/javascript">
	var TOTAL_W_X = <?php echo ($i*125);?>
</script>
<!-- 
	<div class="clear"></div>
	<div class="pagging">
		<div id="agent_browse_escort">
			<?php //echo $pagination['links'];?>
		</div>
	</div>	
</div>
			
<script type="text/javascript">
	
</script>
 -->				